@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><a href="">招生老师信息</a></li>
                <li class="active">招生老师列表</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="btn-toolbar list-toolbar">
                <form class="form-inline" action="" method="get">
                    <div class="form-group">
                        <input type="text" class="form-control" name="name" value="{{$name}}" placeholder="老师" value="">
                    </div>

                    <button type="submit" class="btn btn-default">筛选</button>
                    <a href="/user/teacher/import" class="btn btn-success">导入</a>
                </form>
            </div>
            <div class="row">
                <div class="col-sm-12 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">老师列表</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>姓名</th>
                                <th>手机号</th>
                                <th>openid</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($teachers as $teacher)
                                <tr>
                                    <td>{{$teacher->name}}</td>
                                    <td>{{$teacher->mobile}}</td>
                                    <td>{{$teacher->openid}}</td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            @if($name)
                {{$teachers->appends(['name'=>$name])->render()}}
            @else
                {{$teachers->render()}}
            @endif
        </div>
    </div>
@endsection